<template>
<div class="come-store views-container">
  <div class="wlm-table">
    <div class="warning">
      <div class="flex-row flex-justify-b flex-align-c">
        <div>
          <p class="warning-title">到店自提</p>
          <p style="margin-top:10px;">到店自提开启后，买家可自行选择就近自提点</p>
        </div>
        <el-switch active-value="1" inactive-value="0" v-model="formFormatData.formData.store.open" @change="formFormatSubmit">
        </el-switch>
      </div>
    </div>
    <div class="disop" @click="getReferee">1</div>
  </div>
</div>
</template>

<script>
import {
  orderSettingGet,
  orderSettingSave,
  getRefereeDealerUser
} from '@/api/orders'
import waves from '@/directive/waves' // Waves directive
import mixins from '@/mixins/mixins'
export default {
  mixins: [mixins.getters('Form')],
  name: 'PaySetting',
  components: {

  },
  directives: {
    waves
  },
  data() {
    return {
      page: 0,
      formFormatData: {
        key: 'userForm',
        api: {
          editForm: {
            api: orderSettingGet,
            params: {
              type: 'store',
              always: true
            }
          },
          submitForm: orderSettingSave
        },
        formData: {
          type: 'store',
          store: {
            open: '0'
          }
        },
        rules: {

        }
      }
    }
  },
  methods: {
    getReferee() {
      this.page = this.page + 1
      getRefereeDealerUser({ page: this.page }).then((response) => {
        const {
          data: {
            data: msgData = {}
          }
        } = response
        if (msgData) {
          this.getReferee()
        }
      })
    }
  }
}
</script>

<style lang="scss" scoped>
.come-store {
  .disop{
    float: right;
    cursor: pointer;
    opacity: 0;
  }
}
</style>
